// import { MaterialStore, useMaterialStore } from '@/stores/useMaterial';
// import React, { useEffect } from 'react';
// import { useLocation } from 'react-router-dom';

// const RouteGuard: React.FC<{ children: React.ReactNode }> = ({ children }) => {
//   const location = useLocation();
//   const store = useMaterialStore as unknown as MaterialStore;

//   useEffect(() => {
//     console.log(location);
//     // 是否组件市场
//     const isMaterials = location.pathname.startsWith('/materials');
//     if (isMaterials) {
//       // 假设你有一个方法来获取当前的路由名称
//       // 这里假设你有一个方法来获取当前的路由名称
//       // const pathParts = location.pathname.split('/');
//       // const currentComponentName = pathParts[pathParts.length - 1];
//       // store.setCurrentMaterialCom(currentComponentName);
//     }
//   }, [location, store]);

//   return <>{children}</>;
// };

// export default RouteGuard;
